<include file="public@header"/>
<style type="text/css">
    .pic-list li {
        margin-bottom: 5px;
    }
</style>
<script type="text/html" id="photos-item-tpl">
    <li id="saved-image{id}">
        <input id="photo-{id}" type="hidden" name="photo_urls[]" value="{filepath}">
        <input class="form-control" id="photo-{id}-name" type="text" name="photo_names[]" value="{name}"
               style="width: 200px;" title="图片名称">
        <img id="photo-{id}-preview" src="{url}" style="height:36px;width: 36px;"
             onclick="imagePreviewDialog(this.src);">
        <a href="javascript:uploadOneImage('图片上传','#photo-{id}');">替换</a>
        <a href="javascript:(function(){$('#saved-image{id}').remove();})();">移除</a>
    </li>
</script>
<script type="text/html" id="files-item-tpl">
    <li id="saved-file{id}">
        <input id="file-{id}" type="hidden" name="file_urls[]" value="{filepath}">
        <input class="form-control" id="file-{id}-name" type="text" name="file_names[]" value="{name}"
               style="width: 200px;" title="文件名称">
        <a id="file-{id}-preview" href="{preview_url}" target="_blank">下载</a>
        <a href="javascript:uploadOne('文件上传','#file-{id}','file');">替换</a>
        <a href="javascript:(function(){$('#saved-file{id}').remove();})();">移除</a>
    </li>
</script>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li><a href="{:url('Coil/index')}">列表</a></li>
        <li class="active"><a href="{:url('Coil/add')}">添加</a></li>
        <ul id="files" class="pic-list list-unstyled form-inline">
        </ul>
<!--        <a href="javascript:uploadMultiFile('附件上传','#files','files-item-tpl','file');" class="btn btn-sm btn-default">选择文件</a>-->

    </ul>
    <form method="post" class="form-horizontal js-ajax-form margin-top-20" action="{:url('Coil/addPost')}">

        <div class="form-group">
            <label class="col-sm-2 control-label"><span class="form-required"></span> 钢卷号:</label>
            <div class="col-md-6 col-sm-10">
                <input placeholder="" type="text" class="form-control" name="coilno" value="{$vo.coilno|default=''}">

            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label"><span class="form-required"></span> 采购合同号:</label>
            <div class="col-md-6 col-sm-10">
                <input placeholder="" type="text" class="form-control" name="po_name" value="{$vo.po_name|default=''}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label"><span class="form-required"></span> 采购单价:</label>
            <div class="col-md-6 col-sm-10">
                <input placeholder="" type="text" class="form-control" name="po_price" value="{$vo.po_price|default=''}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label"><span class="form-required"></span> 归属类型:</label>
            <div class="col-md-6 col-sm-10">
                <select name="companytype" class="form-control">
                    <volist name="companytypea_arr" id="ao">
                        <option
                        <if isset($vo.companytype)&&$vo.companytype==$ao.id>selected</if>
                        value="{$ao.id}">{$ao.name}</option>
                    </volist>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label"><span class="form-required"></span> 产权归属:</label>
            <div class="col-md-6 col-sm-10">
                <select name="property_id" class="form-control selectpicker"  data-live-search="true">
                    <option value="">请选择</option>
                    <volist name="company_id_arr" id="ao">
                        <option
                        <if isset($vo.property_id)&&$vo.property_id==$ao.id>selected</if>
                        value="{$ao.id}">{$ao.name}(简称:{$ao.abb_name})</option>
                    </volist>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label"><span class="form-required"></span> 成品品名:</label>
            <div class="col-md-6 col-sm-10">
                <input placeholder="" type="text" class="form-control" name="product" value="{$vo.product|default=''}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label"><span class="form-required"></span> 原料牌号:</label>
            <div class="col-md-6 col-sm-10">
                <select name="steel_grade_id" class="form-control selectpicker"  data-live-search="true">
                    <option value="">请选择</option>
                    <volist name="grade_id_arr" id="ao">
                        <option
                        <if isset($vo.steel_grade_id)&&$vo.steel_grade_id==$ao.id>selected</if>
                        value="{$ao.id}">{$ao.name}</option>
                    </volist>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label"><span class="form-required"></span> 厚:</label>
            <div class="col-md-6 col-sm-10">
                <input placeholder="" type="text" class="form-control" name="d" value="{$vo.d|default=''}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label"><span class="form-required"></span> 宽:</label>
            <div class="col-md-6 col-sm-10">
                <input placeholder="" type="text" class="form-control" name="w" value="{$vo.w|default=''}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label"><span class="form-required"></span> 长:</label>
            <div class="col-md-6 col-sm-10">
                <input placeholder="" type="text" class="form-control" name="h" value="{$vo.h|default='C'}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label"><span class="form-required"></span> 重量(吨):</label>
            <div class="col-md-6 col-sm-10">
                <input placeholder="" type="text" class="form-control" name="weight" value="{$vo.weight|default=''}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label"><span class="form-required"></span> 入库时间:</label>
            <div class="col-md-6 col-sm-10">
                <input autocomplete="off" type="text" class="form-control js-datetime" name="loadingtime"
                       value="{$vo.loadingtime|default=''}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label"><span class="form-required"></span> 客户名称:</label>
            <div class="col-md-6 col-sm-10">
                <select name="company_id[]" class="form-control selectpicker" multiple data-live-search="true">
                    <option value="">请选择</option>
                    <volist name="company_id_arr" id="ao">
                        <option
                        <if isset($vo.company_id)&&$vo.company_id==$ao.id>selected</if>
                        value="{$ao.id}">{$ao.name}(简称:{$ao.abb_name})</option>
                    </volist>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label"><span class="form-required"></span> 所属钢厂:</label>
            <div class="col-md-6 col-sm-10">
                <select name="steel_mill" class="form-control selectpicker"    data-live-search="true">
                    <option value="">请选择</option>
                    <volist name="company_id_arr" id="ao">
                        <option
                        <if isset($vo.steel_mill)&&$vo.steel_mill==$ao.id>selected</if>
                        value="{$ao.id}">{$ao.name}(简称:{$ao.abb_name})</option>
                    </volist>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label"><span class="form-required"></span> 库位:</label>
            <div class="col-md-6 col-sm-10">
                <input placeholder="" type="text" class="form-control" name="locator" value="{$vo.locator|default=''}">
            </div>
        </div>
        <div class="col-sm-offset-2 col-sm-10">
            <button type="submit" class="btn btn-primary js-ajax-submit">保存</button>
            <a class="btn btn-default" href="{:url('Coil/index')}">返回</a>
        </div>
    </form>

</div>
<script src="/static/js/admin.js"></script>
<script src="/static/js/layer/layer.js"></script>
<script>
</script>
</body>
</html>